const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        code: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        status: 1,
        totalFee: 10,
        claimtTotalFee: 10,
        createTime: '2019-09-12T10:23:26.760Z',
        rowVersion: 'string',
        options: [
            'update',
            'confirmor',
            'invoice',
            'abandon',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                code: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                status: 1,
                totalFee: 10,
                claimtTotalFee: 10,
                createTime: '2019-09-12T10:24:56.159Z',
                partInvoiceId: 'string',
                brandId: '1',
                brandCode: 'string',
                brandName: 'string',
                dealerId: '1',
                branchCode: 'string',
                branchName: 'string',
                creatorName: 'string',
                modifierName: 'string',
                modifyTime: '2019-09-12T10:24:56.159Z',
                confirmorName: 'string',
                confirmTime: '2019-09-12T10:24:56.159Z',
                invoiceConfirmorName: 'string',
                invoiceConfirmTime: '2019-09-12T10:24:56.159Z',
                payerName: 'string',
                payTime: '2019-09-12T10:24:56.159Z',
                abandonerName: 'string',
                abandonTime: '2019-09-12T10:24:56.159Z',
                rowVersion: 'string',
                options: [
                    'update',
                    'confirmor',
                    'invoice',
                    'abandon',
                ],
                attachments: [{
                    fileId: 'te1232-131232-1we',
                    fileName: '安装背景图1'
                },
                {
                    fileId: 'qww1-232131-12e',
                    fileName: '安装背景图2'
                }],
                details: [
                    {
                        id: '1',
                        reportCode: 'string',
                        claimCode: 'string',
                        claimType: 1,
                        currency: 1,
                        partId: 'string',
                        partCode: 'string',
                        partName: 'string',
                        packingListCode: 'string',
                        partSaleOrderCode: 'string',
                        cacuQuantity: 1,
                        price: 1,
                        mgmtFee: 1,
                        cacuFee: 1,
                        claimFee: 1,
                        claimReason: 1
                    }
                ]
            }
        }
    );
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});
router.post('/', (req, res) => {
    res.json({
        message: '新增成功'
    });
});
router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废成功'
    });
});
router.put('/:id/confirmor', (req, res) => {
    res.json({
        message: '确认成功'
    });
});
router.put('/:id/invoice', (req, res) => {
    res.json({
        message: '发票确认成功'
    });
});
module.exports = router;
